/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.archwood.frc2607.logomotion;
import edu.wpi.first.wpilibj.Servo;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.camera.AxisCamera;
import edu.wpi.first.wpilibj.camera.AxisCameraException;
import edu.wpi.first.wpilibj.image.ColorImage;
import edu.wpi.first.wpilibj.image.NIVisionException;

/**
 *
 *Author: John
 */
public class Camera {
    public AxisCamera MyName;
   public Servo ServoServo;
public Servo ServoServoServo;
public Camera()
    {
    Timer.delay(8);
  MyName = AxisCamera.getInstance();
   MyName.writeResolution(AxisCamera.ResolutionT.k640x480);
   ServoServo = new Servo(1);
   ServoServoServo = new Servo(2);
  // ServoServo.set(.5);
  // ServoServoServo.set(.5);
    }
public void SendImage()
    {

    if (MyName.freshImage())
    {
            try
            {
                ColorImage e = MyName.getImage();
            //
                e.free();
            }
            catch (AxisCameraException ex) {
                ex.printStackTrace();
            }
            catch (NIVisionException ex) {
                ex.printStackTrace();
            }
    }
    }
}
